﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SSE657.BahMap.Business;
using SSE657.BahMap.Common;
using SSE657.BahMap.DataAccess;
namespace SSE657.BahMap.MVC.Test.Mocks
{
    public class MockBAHMapSession: IBAHMapSession
    {
        public List<RateData> GetRates(PayGrade grade, bool dependents)
        {
            throw new NotImplementedException();
        }

        public Dictionary<RateData, double> GetRatesPercentiles(PayGrade grade, bool dependents)
        {
            var list = new Dictionary<RateData, double>();
            
            list.Add(new RateData()
            {
                Rate = 1000,
                Grade = PayGrade.E1,
                Dependents = false,
                Area = new Area()
                {
                    MHA = "GA079",
                    ZIPs = new List<int>(new int[] { 31210, 31216, 31207, 31206 })
                }
            }, .946);
            return list;
        }

        public KeyValuePair<double, double> GetRatePercentile(int zip, PayGrade grade, bool dependents)
        {
            throw new NotImplementedException();
        }

        // how does consumer want the data of all rates in a specified ZIP/MHA? Table? List? Dictionary of PayGrade to Rates, or of dependents to Rates?
        public Dictionary<PayGrade, Dictionary<bool, RateData>> GetAllRates(int zipcode)
        {
            var list = new Dictionary<PayGrade, Dictionary<bool, RateData>>();
            var rateData = new Dictionary<bool, RateData>();
            rateData.Add(true, new RateData()
            {
                Rate = 1000,
                Grade = PayGrade.E1,
                Dependents = true,
                Area = new Area()
                {
                    MHA = "GA079",
                    ZIPs = new List<int>(new int[] { 31210, 31216, 31207, 31206 })
                }
            });
            rateData.Add(false, new RateData()
            {
                Rate = 900,
                Grade = PayGrade.E1,
                Dependents = false,
                Area = new Area()
                {
                    MHA = "GA079",
                    ZIPs = new List<int>(new int[] { 31210, 31216, 31207, 31206 })
                }
            });
            list.Add(PayGrade.E1, rateData);
            return list;
        }

        public Dictionary<PayGrade, Dictionary<bool, RateData>> GetAllRates(string mha)
        {
            var list = new Dictionary<PayGrade, Dictionary<bool, RateData>>();
            var rateData = new Dictionary<bool, RateData>();
            rateData.Add(true, new RateData()
            {
                Rate = 800,
                Grade = PayGrade.E1,
                Dependents = true,
                Area = new Area()
                {
                    MHA = "GA079",
                    ZIPs = new List<int>(new int[] { 31210, 31216, 31207, 31206 })
                }
            });
            rateData.Add(false, new RateData()
            {
                Rate = 700,
                Grade = PayGrade.E1,
                Dependents = false,
                Area = new Area()
                {
                    MHA = "GA079",
                    ZIPs = new List<int>(new int[] { 31210, 31216, 31207, 31206 })
                }
            });
            list.Add(PayGrade.E1, rateData);
            return list;
        }

        public IEnumerable<SchoolData> GetSchools(string MHA)
        {
            var list = new List<SchoolData>();
            list.Add(new SchoolData
            {
                SchoolName = "Mercer"
            }
            );
            return list;
        }

        public IEnumerable<SchoolData> GetSchools(int zipcode)
        {
            var list = new List<SchoolData>();
            list.Add(new SchoolData
            {
                SchoolName = "Macon State"
            }
            );
            return list;
        }
    }
}
